<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>实现两个数交换 判断奇数偶数</title>
</head>

<body>

</body>

</html>
<script>
    //实现两个数交换
    var num1 = 10;
    var num2 = 24;
    console.log([num1,num2] = [num2,num1]); ;
</script>
<script>
    //判断奇数偶数
    var arr = prompt('请输入数值');
    if (arr === 0) {
        alert('不是奇数也不是偶数');
    } if (arr % 2 != 0) {
        alert('是奇数')
    } else if (arr % !2 == 0) {
        alert('是偶数')
    }
</script>